<template>
  <div class="label-data-picker">
    <div class="label">{{ label }}</div>
    <el-date-picker v-model="month" v-bind="$attrs" v-on="$listeners">
    </el-date-picker>
  </div>
</template>

<script>
export default {
  name: "LabelDataPicker",
  props: {
    value: {
      type: Date | String,
      default: "",
    },
    label: {
      type: String,
      default: "日期",
    },
  },
  computed: {
    month: {
      set(value) {
        this.$emit("input", value);
      },
      get() {
        return this.value;
      },
    },
  },
};
</script>

<style lang="less" scoped>
.label-data-picker {
  display: flex;
  align-items: center;
  column-gap: 6px;
  .label {
    padding: 4px 5px;
    border-radius: 5px;
    background-color: #bf0000;
    color: #fff;
    font-size: 14px;
  }
}
</style>
